<include file="public/layout" />

<script src="__PUBLIC__/js/laydate/laydate.js" type="text/javascript"></script>
<body style="background-color: #FFF; overflow: auto;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>平台设置</h3>
                <h5>网站全局内容基本选项设置</h5>
            </div>
            <ul class="tab-base nc-row">
                <foreach name="group_list" item="v" key="k">
                    <li><a href="{:U('System/index',['inc_type'=> $k])}" <if condition="$k==$inc_type">class="current"</if>><span>{$v}</span></a></li>
                </foreach>
            </ul>
        </div>
    </div>
    <!-- 操作说明 -->
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span id="explanationZoom" title="收起提示"></span> </div>
        <ul>
            <li>系统平台设置</li>
        </ul>
    </div>
    <form method="post" id="handlepost" action="{:U('System/handle')}" enctype="multipart/form-data" name="form1">
        <input type="hidden" name="form_submit" value="ok" />
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="store_title">网站状态</label>
                </dt>
                <dd class="opt">
                    <label><input type="radio" name="close_open" value="1" <if condition="$config[close_open] eq 1"> checked="checked"</if>> 开启 </label>
                    <label><input type="radio" name="close_open" value="0" <if condition="$config[close_open] eq 0"> checked="checked"</if>> 关闭</label>
                </dd>
            </dl>
         <dl class="row">
                <dt class="tit">
                    <label for="store_title">中奖概率</label>
                </dt>
                <dd class="opt">
                    <input id="thinks" name="thinks" value="{$config.thinks}" class="input-txt" type="text" />
                    <p class="notic">(0.01 等同于1%) 请填小数 </p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="store_title">网站地址</label>
                </dt>
                <dd class="opt">
                    <input id="web_url" name="web_url" value="{$config.web_url}" class="input-txt" type="text" />
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="store_title">网站名称</label>
                </dt>
                <dd class="opt">
                    <input id="store_title" name="store_title" value="{$config.store_title}" class="input-txt" type="text" />
                </dd>
            </dl>
       <!--     <dl class="row">
                <dt class="tit">
                    <label for="store_title">奖品领完提示</label>
                </dt>
                <dd class="opt">
                    <input id="store_titl" name="notice" value="{$config.notice|default='奖品已经领取完，谢谢您的支持'}" class="input-txt" type="text" />
                </dd>
            </dl>-->
            <dl class="row">
                <dt class="tit">
                    <label for="store_title" id="start_time-1">活动开始日期</label>
                </dt>
                <dd class="opt">
                    <div class="control-group">
                        <div class="controls">
                            <div class="input-prepend input-group">
                                    <span class="add-on input-group-addon">
                                            <i class="glyphicon glyphicon-calendar fa fa-calendar">
                                            </i>
                                    </span>
                                <input type="text" style="width: 300px" name="begin" id="start_time" class="form-control" value="{$config.begin}">
                            </div>
                        </div>
                    </div>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="store_title" id="end_time-1">活动结束时间</label>
                </dt>
                <dd class="opt">
                    <div class="control-group">
                        <div class="controls">
                            <div class="input-prepend input-group">
                                <span class="add-on input-group-addon">
                                        <i class="glyphicon glyphicon-calendar fa fa-calendar">
                                        </i>
                                </span>
                                <input type="text" style="width: 300px" name="end" id="end_time" class="form-control" value='{$config.end}'>
                            </div>
                        </div>
                    </div>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="store_title">分享标题</label>
                </dt>
                <dd class="opt">
                    <input id="page_title" name="page_title" value="{$config.page_title}" class="input-txt" type="text" />
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="store_title">分享描述</label>
                </dt>
                <dd class="opt">
                    <input id="page_desc" name="page_desc" value="{$config.page_desc}" class="input-txt" type="text" />
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="shareImg">分享封面图片</label>
                </dt>
                <dd class="opt">
                    <div class="input-file-show">
                        <span class="show">
                            <a id="shareImg_a" target="_blank" class="nyroModal" rel="gal" href="{$config.shareImg}">
                                <i id="shareImg_i" class="fa fa-picture-o" onmouseover="layer.tips('<img src={$config.shareImg}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();"></i>
                            </a>
                        </span>
                        <span class="type-file-box">
                            <input type="text" id="shareImg" name="shareImg" value="{$config.shareImg}" class="type-file-text">
                            <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
                            <input class="type-file-file" onClick="GetUploadify(1,'shareImg','picture','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图，点击按钮选择文件并提交表单后上传生效">
                        </span>
                    </div>
                    <span class="err"></span>
                    <p class="notic">分享封面图片</p>
                </dd>
            </dl>
            <script type="text/javascript">

                function img_call_back(fileurl_tmp)
                {
                    $("#shareImg").val(fileurl_tmp);
                    $("#shareImg_a").attr('href', fileurl_tmp);
                    $("#shareImg_i").attr('onmouseover', "layer.tips('<img src="+fileurl_tmp+">',this,{tips: [1, '#fff']});");
                }

            </script>
      <!--      <dl class="row">
                <dt class="tit">
                    <label for="store_title">二维码</label>
                </dt>
                <dd class="opt">
                    <img src="/public/ewm/ewm.png">
                    <p class="notic"></p>
                </dd>
            </dl>-->

            <div class="bot">

                <input type="hidden" name="inc_type" value="{$inc_type}">
     <!--           <a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form1.submit()">确认提交</a>-->
                <a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="adsubmit()">确认提交</a>
            </div>
        </div>
    </form>
</div>
<div id="goTop"> <a href="JavaScript:void(0);" id="btntop"><i class="fa fa-angle-up"></i></a><a href="JavaScript:void(0);" id="btnbottom"><i class="fa fa-angle-down"></i></a></div>
</body>
<script type="text/javascript">
    //时间选择器
    laydate.render({
        elem: '#start_time'
        ,type: 'datetime',
    });
    //时间选择器
    laydate.render({
        elem: '#end_time'
        ,type: 'datetime',
    });

    function adsubmit(){
        var start = new Date($('#start_time').val()).valueOf();
        var end  = new Date($('#end_time').val()).valueOf();
        if(start !=''  && end !=''){
            if(start > end){
                layer.alert('开始时间不能大于结束时间');
                return false;
            }
        }
        $('#handlepost').submit();
    }
</script>
</html>